package yt.demo.appcommondb.base;

import com.github.yulichang.wrapper.MPJLambdaWrapper;
import yt.demo.appcommonbean.http.DeleteRequest;
import yt.demo.appcommondb.dto.SplitPageDTO;
import yt.demo.appcommondb.vo.ConditionVO;
import yt.demo.appcommondb.vo.PageVO;
import java.util.List;
import java.util.function.Consumer;

public interface IBaseService <T extends BaseEntity<T>>  {

    PageVO<T> getPageList(SplitPageDTO dto, T params, Consumer<MPJLambdaWrapper<T>> consumer,List<ConditionVO<T, ?>> whereConditions);

    List<T> getList( T params, Consumer<MPJLambdaWrapper<T>> consumer,List<ConditionVO<T, ?>> whereConditions);

    T create(T req);

    T update(T req);

    boolean batchInsert(List<T> list);

    void deleteWhere(List<ConditionVO<T, ?>> whereConditions);

    void delete(DeleteRequest req);

    void deleteById(Long id);

    void deleteByIds(List<Long> ids);

    T detail(Long id);

    T detail(Integer id);

    List<T> selectBatchIds(List<Long> ids);

}
